package com.maixun.lib_business_college.net

import com.maixun.lib_comment.interceptor.NetInterceptor
import com.maixun.lib_network.base.NetworkApi
import okhttp3.Interceptor

/**
 * @author：Lmoumou
 * @date：2020/11/5
 */
class QANetWork : NetworkApi(){

    companion object {
        @Volatile
        private var instance: QANetWork? = null

        private fun getInstance(): QANetWork {
            return instance ?: synchronized(this) {
                instance ?: QANetWork().also { instance = it }
            }
        }

        fun getService(): QAApiService {
            return getInstance().getRetrofit(QAApiService::class.java)
                .create(QAApiService::class.java)
        }
    }

    override fun getInterceptor(): Interceptor? {
        return NetInterceptor()
    }
}